import { createStore,applyMiddleware, compose } from 'redux'
import reducers from './reducers'

// thunk中间件，用于异步请求
import thunk from 'redux-thunk'
// 浏览器调试中间件
const composeEnhancers =window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
// 有过个中间件的时候，需要合并
const enhancer = composeEnhancers(
    applyMiddleware(thunk),
    // other store enhancers if any
  );

const store = createStore(reducers, enhancer)

export default store